#include "serialconfig.h"
#include "ui_serialconfig.h"

SerialConfig::SerialConfig(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::SerialConfig)
{
    ui->setupUi(this);
}

SerialConfig::~SerialConfig()
{
    delete ui;
}
void SerialConfig::serialSetPortName(QStringList _name)
{
    ui->portComboBox->clear();
    ui->portComboBox->addItems(_name);
}
void SerialConfig::serialGetConfig(struct serialConfigData *_config)
{
    _config->port = ui->portComboBox->currentIndex();
    _config->baudRate = ui->baudComboBox->currentIndex();
    _config->dataBits = ui->dataComboBox->currentIndex();
    _config->stopBits = ui->stopComboBox->currentIndex();
    _config->parity = ui->parityComboBox->currentIndex();

}

void SerialConfig::on_scanPushButton_clicked()
{
    emit serialScan();
}

